****************************************************************************************************************************************************
***Analysis of Voxmeter data for Pedersen and Pedersen: "Citizen Attitudes on Politicians' Pay: Trust Issues are not Solved by Delegation" *********
****************************************************************************************************************************************************
***Written for STATA 15 ****************************************************************************************************************************
****************************************************************************************************************************************************


**********************************
***Installing required packages***
**********************************
* ssc install estout //Run this line if estout is not already installed (used when creating regression tables)
* ssc install coefplot //Run this line if "Coefplot" is not already installed (used when plotting results in graphs)
* ssc install blindschemes //Run this line if "blindschemes is not already installed (used to control graph layout) 


*******************************
***Setting the figure scheme***
*******************************
set scheme plotplain
graph set window fontface perpetua


**********************
***Getting the data***
**********************
clear all
set more off, permanently
cd "C:\Politicians_pay"
import excel "C:\Politicians_pay\Rawdata_Citizen_Attitudes_on_Politicians_Pay.xlsx", sheet("gridExport_0") firstrow
	

*************************
***Setting up the data***
*************************

*Pre-treatment variables

	*Gender
	destring PB_Gender, replace 
	recode PB_Gender (2=1 "Female") (1=0 "Male"), gen(Female)
	label define respondent_gender 0 "Male respondent" 1 "Female Respondent"
	label values Female respondent_gender

	*Age
	destring PB_Age, replace
	gen Age=PB_Age
	
	*Geographical Region
	destring PB_Region, replace
	recode PB_Region (1=1 "Hovedstaden") (2=2 "Sjælland") (3=3 "Syddanmark") (4=4 "Midtjylland") (5=5 "Nordjylland"), gen(Region)
	
	*Education
	destring PB_Higher_Education, replace
	recode PB_Higher_Education 	(1=1 "School, basic") ///
								(2 3=2 "High School") ///
								(4=3 "Vocational") ///
								(5=4 "Short tert.") ///
								(6=5 "medium tert.") ///
								(7 8 =6 "long tert.") ///
								(else=.), gen(education) 
								
	recode education(1/2=1 "High School or less") (3=2 "Vocational") (4/8=3 "Some college" ), gen(edu3)
	
	*Party Choice
	destring Q1, replace
	recode Q1	(1=1  "A: Social Democrats") ///
				(2=2  "B: Social Liberals") ///
				(3=3  "C: Conservatives") ///
				(4=4  "D: New right") ///
				(5=5  "F: Socialist People's Party") ///
				(6=6  "I: Liberal Alliance") ///
				(7=7  "K: Christian Democrats") ///
				(8=8  "O: Danish People's Party") ///
				(9=9  "V: Liberals") /// 
				(10=10 "Ø: Unity List") ///
				(11=11 "Å: The Alternative") ///
				(12 13 14 15=12 "Other / Don't Know") ///
				, gen(partychoice)
	
	*Left-Right
	destring Q2, replace
	recode Q2 (11=.), gen(uns_LR)
	generate LR=uns_LR/10
		
	*Inequality Aversion
	destring Q3_SQ_0, replace 
	recode Q3_SQ_0 (6=.), gen(uns_smalldif)
	gen smalldif=(uns_smalldif-1)/4
	
	destring Q3_SQ_1, replace
	recode 	Q3_SQ_1 (6=.), gen(uns_largedif)
	gen largedif=(uns_largedif-1)/4
	
	factor LR smalldif largedif
	alpha LR smalldif largedif, item std gen(uns_inequality_attitude) //Internal reliability is acceptable
	egen uns_inequality_attitude_min=min(uns_inequality_attitude) //these lines standardize the measure to 0-1
	egen uns_inequality_attitude_max=max(uns_inequality_attitude) //these lines standardize the measure to 0-1
	gen inequality_aversion=1-(uns_inequality_attitude-uns_inequality_attitude_min)/(uns_inequality_attitude_max-uns_inequality_attitude_min) //these lines standardize the measure to 0-1, AND CHANGE THE DIRECTION!
	label variable inequality_aversion "Aversion to Economic Inequality"
	egen float inequality_aversion_high = cut(inequality_aversion), group(2) icodes
	sum inequality_aversion
	gen in_minus_sd=(r(mean)-r(sd))
	gen in_plus_sd=(r(mean)+r(sd))

	*Trust, politicians in parliament
	destring Q4, replace
	recode Q4 (11=.), gen(uns_trust)
	gen trust=uns_trust/10
	label variable trust "General Political Trust"
	egen float trust_high = cut(trust), group(2) icodes
	egen float trust_3 =cut(trust), group(3)
	sum trust
	gen trust_minus_sd=(r(mean)-r(sd))
	gen trust_plus_sd=(r(mean)+r(sd))
	
*Experimental conditions
	destring D_Q_Select, replace
	recode D_Q_Select 	(1=1 "Control Condition") ///
						(2=2 "Increase suggested by Political Com.") ///
						(3=3 "Increase suggested by Independent Com.") ///
						(4=4 "Decrease suggested by Political Com") ///
						(5=5 "Decrease suggested by Independent Com.") ///
						, gen(Condition)
		
	recode Condition (2/3=2 "Increase") (1=1 "Control") (4/5=0 "Decrease"), gen(Increase_proposal)	
	recode Condition (2 4=2 "Politicians") (1=1 "Control") (3 5=0 "Comission"), gen(Pol_proposal)		
	recode Condition (1=0 "Control") (2/5=1 "Stimuli"), gen(exposed_to_proposal)
	
*Post-treatment variables	

	*Support for proposal
	destring Q5, replace
	recode Q5 (6=.), gen(uns_support_proposal)
	gen Support_proposal=(uns_support_proposal-1)/4
		
	*Trait perceptions
	destring Q6_SQ_0, replace
	recode Q6_SQ_0 (6=.), gen(intelligent)
	destring Q6_SQ_1, replace
	recode Q6_SQ_1 (6=.), gen(skilled)
	destring Q6_SQ_2, replace
	recode Q6_SQ_2 (6=.), gen(knowledgeable)
	destring Q6_SQ_3, replace
	recode Q6_SQ_3 (6=.), gen(friendly)
	destring Q6_SQ_4, replace
	recode Q6_SQ_4 (6=.), gen(conscientious)
	destring Q6_SQ_5, replace
	recode Q6_SQ_5 (6=.), gen(caring)
	
	destring Q7_SQ_0, replace 
	recode Q7_SQ_0 (6=.), gen(mostly_competent)
	destring Q7_SQ_1, replace 
	recode Q7_SQ_1 (6=.), gen(right_decisions)	
	
	destring Q7_SQ_2, replace 
	recode Q7_SQ_2 (6=.), gen(good_intentions)
	destring Q7_SQ_3, replace 
	recode Q7_SQ_3 (6=.), gen(personal_gain)	
	
	alpha friendly conscientious caring good_intentions personal_gain, item std //The item "personal_gain" lowers internal reliability and is therefore excluded from the index (c.f preregistration)
	alpha friendly conscientious caring good_intentions , item std gen(uns_warmth)
	egen uns_warmth_min=min(uns_warmth) //these lines standardize the measure to 0-1
	egen uns_warmth_max=max(uns_warmth) //these lines standardize the measure to 0-1
	gen Warmth=(uns_warmth-uns_warmth_min)/(uns_warmth_max-uns_warmth_min) //these lines standardize the measure to 0-1
	
	alpha intelligent skilled knowledgeable mostly_competent right_decisions, item std gen(uns_competence)
	egen uns_competence_min=min(uns_competence) //these lines standardize the measure to 0-1
	egen uns_competence_max=max(uns_competence) //these lines standardize the measure to 0-1
	gen Competence=(uns_competence-uns_competence_min)/(uns_competence_max-uns_competence_min) //these lines standardize the measure to 0-1
		
	
	*Perceived Influence from politicians on Commission
	destring Q9, replace
	recode Q9 (6=.), gen(uns_influence)
	gen Influence=uns_influence/5
	
	*Content of proposal
	destring Q10, replace
	gen correct_recall=.
	replace correct_recall=0 if Q10<6
	replace correct_recall=1 if Q10==2 & Increase_proposal==2
	replace correct_recall=1 if Q10==4 & Increase_proposal==0
	
	*Dropping obsolete variables
	drop 	Id PB_Gender PB_Age PB_Region PB_Higher_Education Q1 Q2 Q3_SQ_0 Q3_SQ_1 Q4 ///
			D_Q_Select Q5 Q6_SQ_0 Q6_SQ_1 Q6_SQ_2 Q6_SQ_3 Q6_SQ_4 Q6_SQ_5 Q7_SQ_0 Q7_SQ_1 Q7_SQ_2 Q7_SQ_3 ///
			Q9 uns_inequality_attitude_min uns_inequality_attitude_max ///
			uns_competence_min uns_competence_max uns_warmth_min uns_warmth_max
	

***************************************************************************************************************************************************************************************
***ANALYSES****************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************

************************************
***Respondent Descriptives**********
************************************

tab Completed // Overall completion rate was 91.1%
tab Completed if Condition!=. // Just 1.6% attrition rate among respondents exposed to stimuli
tab Completed Condition, chi //No significant differences in attrition across conditions

tab Female if Completed==1
sum Age if Completed==1
tab Region if Completed==1
tab education if Completed==1
tab edu3 if Completed==1
tab partychoice if Completed==1
tab LR if Completed==1
sum LR if Completed==1

kdensity trust, 				title("General Political Trust (pre-treatment)") note(" ") plotregion(lcolor(none)) ///
								ylabel(0(.5)2.5, labsize(medium) angle(0) gmax) ytitle(, size(medium))  xlabel(,labsize(medium)) xtitle(" ", size(zero))   graphregion(margin(top))
								graph save kdensity_trust, replace
kdensity inequality_aversion,	title("Aversion to Economic Inequality (pre-treatment)") note(" ") plotregion(lcolor(none)) ///
								ylabel(0(.5)2.5, labsize(medium) angle(0) gmax) ytitle(, size(medium))  xlabel(,labsize(medium)) xtitle(" ", size(zero))  graphregion(margin(top))
								graph save kdensity_inequality_attitude, replace
kdensity Warmth, 				title("Trust in Politicians' Warmth (post-treatment)") note(" ") plotregion(lcolor(none)) ///
								ylabel(0(.5)2.5, labsize(medium) angle(0) gmax) ytitle(, size(medium))  xlabel(,labsize(medium)) xtitle(" ", size(zero))  graphregion(margin(top))
								graph save kdensity_warmth, replace
kdensity Competence, 			title("Trust in Politicians Competence (post-treatment)") note(" ") plotregion(lcolor(none)) ///
								ylabel(0(.5)2.5, labsize(medium) angle(0) gmax) ytitle(, size(medium))  xlabel(,labsize(medium)) xtitle(" ", size(zero))  graphregion(margin(top))
								graph save kdensity_competence, replace
graph combine 					kdensity_trust.gph kdensity_inequality_attitude.gph kdensity_warmth.gph kdensity_competence.gph, col(1) imargin(0 0 0 0) iscale(.5) ysize(6) xsize(6) plotregion(lcolor(black)) ///
								note("Note: The graphs shows the distributions of respondent values across the possible" "range of the variables (Epanechnikow kernel function)", size(small))
								graph export kdensity.emf, replace

pwcorr trust inequality_aversion Warmth Competence, sig obs

*************************************************************
***Attitude regarding proposed change in politicians' pay ***
*************************************************************

**MAIN**
********

reg Support_proposal i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
estimates store support_pro 

margins, at(Condition=(2 3 4 5)) pwcompare(effects groups)
//Results in line with H1: Citizens show higher support for a pay decrease than a pay increase for politicians (support for proposal higher in condition(4+5) than in condition(2+3).
//Results in line with H2: Citizens show lower support for a pay increase when comming from politicians (support lower in condition 2 than condition 3)
//Results NOT in line with H3: Support for pay decrease does not depend oin sponsor of proposal (no significant difference between condition 4 and 5)


margins, at(Condition=(2 3 4 5)) post
eststo main
coefplot   	(main,  msymbol(circle) msize(medlarge) mcolor(gs12)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			, vert ytitle("Support for Proposal", size(medlarge)) title("Figure 1: Support for Proposal, Conditional on Treatment", size(large)) legend(order(0 " ") width(25)) ///
			ylabel(0(.1).8,labsize(medium) gmin gmax) xline(1.5 2.5 3.5, lcolor(gs10) lstyle(dot)) ///
			coeflabels 	(1._at= `" "Increase by" "Political Com." "'  ///
						 2._at=  `" "Increase by" "Independent Com." "' ///
						 3._at=  `" "Decrease by" "Political Com." "' ///
						 4._at=  `" "Decrease by" "Independent Com." "',  labsize(medium) ) ///
			caption("Note: Estimates with 95% confidence intervals (Based on model 1, appendix D)." ///
					"          ", span size(medium)) ///
						xsize(6.5) ysize(3.5)
			graph export FIG1.emf, replace	
			
			
*ALTERNATIVE - HORISONTAL		
/*coefplot   	(main,  msymbol(circle) msize(large) mcolor(gs14)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			, xtitle("Support for Proposal", size(medlarge)) title("Figure 1: Support for Proposal, Conditional on Treatment", size(vlarge)) ///
			xlabel(0(.1).8,labsize(medium) gmin gmax) level(95) ///
			coeflabels 	(1._at= `" "Increase suggested" "by Political Com." "'  ///
						 2._at=  `" "Increase suggested" "by Independent Com." "' ///
						 3._at=  `" "Decrease suggested" "byPolitical Com." "' ///
						 4._at=  `" "Decrease suggested" "by Independent Com." "', grid labsize(medium) ) ///
			caption(" " "Note: The figure illustrates mean support for proposed change in politicians pay, conditional on " ///
						"content and sponsor of proposal (With 95% confidence intervals).",  size(medium)) ///
			xsize(5.5) ysize(3)			
			graph export FIG1a.emf, replace	
*/
						
	
**TRUST**	
*********
estimates restore support_pro 
margins, dydx(trust) at(Condition=(2 3 4 5)) pwcompare(effects groups)
margins, dydx(trust) at(Condition=(2 3 4 5)) post
eststo support_pro_trust
//Results in line with H4: Citizens with a high level of political trust show lower relative support for a pay decrease than citizens with a low level of political trust. 


***Trust - Comparing -1SD and +1SD**

local trust_minus_sd=trust_minus_sd
local trust_plus_sd=trust_plus_sd
estimates restore support_pro
margins, at(Condition=(2 3 4 5) trust=(`trust_minus_sd' `trust_plus_sd')) post coefleg 
 
*when politicians suggest
lincom _b[5._at]- _b[1bn._at] //massive change among least trusting
lincom _b[6._at]- _b[2._at] //less than half the effect among most trusting
lincom (_b[5._at]- _b[1bn._at])- ( _b[6._at]- _b[2._at]) //effect significantly larger among least trusting

*when independent commission suggests
lincom _b[7._at]- _b[3._at] //massive change among least trusting
lincom _b[8._at]- _b[4._at] //less than half the effect among most trusting
lincom (_b[7._at]- _b[3._at])- ( _b[8._at]- _b[4._at]) //effect significantly larger among least trusting

*Collapsing across politicians and commission
lincom (_b[5._at]+_b[7._at])/2
lincom (_b[1bn._at]+_b[3._at])/2
lincom ((_b[5._at]+_b[7._at])/2)- ((_b[1bn._at]+_b[3._at])/2) //massive change among least trusting
lincom ((_b[6._at]+_b[8._at])/2)
lincom ((_b[2._at]+_b[4._at])/2)
lincom ((_b[6._at]+_b[8._at])/2)- ((_b[2._at]+_b[4._at])/2) //less than half the effect among most trusting
lincom (((_b[5._at]+_b[7._at])/2)- ((_b[1bn._at]+_b[3._at])/2)) - (((_b[6._at]+_b[8._at])/2)- ((_b[2._at]+_b[4._at])/2))

	*Trust - figure
	local trust_minus_sd=trust_minus_sd
	local trust_plus_sd=trust_plus_sd
	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) trust=(`trust_minus_sd' `trust_plus_sd')) post coefleg 

	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) trust=(0)) post 
	eststo trust_vlow

	local trust_minus_sd=trust_minus_sd
	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) trust=(`trust_minus_sd')) post 
	eststo trust_low

	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) trust=(.4467099)) post 
	eststo trust_mean

	local trust_plus_sd=trust_plus_sd
	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) trust=(`trust_plus_sd')) post 
	eststo trust_high

	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) trust=(1)) post 
	eststo trust_vhigh


	coefplot   	(trust_low,  msymbol(circle)       msize(medlarge) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02) label("Low level" "of trust" )) ///
				(trust_high, msymbol(hollowcircle) msize(medlarge) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02)  label("High level" "of trust")) ///
				, vert ytitle("Support for Proposal", size(medlarge)) title("Figure 2: Support for Proposal, Conditional on Treatment and Trust", size(large) span) legend(cols(1)  subtitle("") position(4) size(medium) width(25)) ///
				ylabel(0(.1).8,labsize(medium) gmin gmax) level(95) xline(1.5 2.5 3.5, lcolor(gs10) lstyle(dot))  ///
				coeflabels 	(1._at= `" "Increase by" "Political Com." "'  ///
							 2._at=  `" "Increase by" "Independent Com." "' ///
							 3._at=  `" "Decrease by" "Political Com." "' ///
							 4._at=  `" "Decrease by" "Independent Com." "',  labsize(medium) ) ///
				caption("Note: Estimates with 95% confidence intervals (Based on model 1, appendix D)." ///
						"          Low/High level of trust defined as mean -/+ 1 standard deviation" , span size(medium)) ///
							xsize(6.5) ysize(3.5)
				graph export FIG2.emf, replace	

*ALTERNATIVE - HORISONTAL
/*	coefplot   	(trust_low,  msymbol(circle)       msize(large) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02) label("Low level of trust" "(Mean - 1 SD)")) ///
				(trust_high, msymbol(hollowcircle) msize(large) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02)  label("High level of trust" "(Mean + 1 SD)")) 	///
				, xtitle("Support for Proposal", size(medlarge)) title("Figure 2: Support for Proposal, Conditional on Treatment and Trust", size(vlarge)) legend(cols(1)  subtitle("") position(2) size(medlarge)) level(95) ///
				xlabel(0(.1).8,labsize(medium) gmin gmax)  ///
				coeflabels 	(1._at= `" "Increase suggested"  "by Political Com." "'  ///
							2._at=  `" "Increase suggested"  "by Independent Com." "' ///
							3._at=  `" "Decrease suggested"  "by Political Com." "' ///
							4._at=  `" "Decrease suggested"  "by Independent Com." "', grid labsize(medium) ) ///
				caption(" " "Note: The figure illustrates mean support for proposed change in politicians pay, conditional on " ///
							"content of proposal, sponsor and respondent trust (With 95% confidence intervals).", size(medium)) ///
				xsize(6.5) ysize(3)			
				graph export FIG2a.emf, replace
				
*/				

*TRUST - addtional exploratory analysis
reg Support_proposal i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion i.Condition##i.Female i.Condition##c.Age i.Condition##i.edu3 i.Condition##i.partychoice //additional controls
eststo support_pro_control
margins, dydx(trust) at(Condition=(2 3 4 5)) post
eststo support_pro_trust_control
	

**INEQUALITY**
**************

estimates restore support_pro
margins, dydx(inequality_aversion) at(Condition=(2 3 4 5)) pwcompare(effects groups)
margins, dydx(inequality_aversion) at(Condition=(2 3 4 5)) post
eststo support_pro_in
//Results are in line with H5

**INEQUALITY  - Comparing -1SD and +1SD***
local in_minus_sd=in_minus_sd
local in_plus_sd=in_plus_sd
estimates restore support_pro
margins, at(Condition=(2 3 4 5) trust=(`in_minus_sd' `in_plus_sd')) post coefleg	
	
*when politicians suggest
lincom _b[5._at]- _b[1bn._at] //large change among 
lincom _b[6._at]- _b[2._at] //a bit smaller effect among 
lincom (_b[5._at]- _b[1bn._at])- ( _b[6._at]- _b[2._at]) //effect significantly larger among 

*when independent commission suggests
lincom _b[7._at]- _b[3._at] //large change among 
lincom _b[8._at]- _b[4._at] //somewhat smaller effect among most trusting
lincom (_b[7._at]- _b[3._at])- ( _b[8._at]- _b[4._at]) //effect significantly larger among least trusting

*Collapsing across politicians and commission
lincom ((_b[5._at]+_b[7._at])/2)- ((_b[1bn._at]+_b[3._at])/2) //substantial effect among respondents with 
lincom ((_b[6._at]+_b[8._at])/2)- ((_b[2._at]+_b[4._at])/2) //substantial effect among respondents with 
lincom (((_b[5._at]+_b[7._at])/2)- ((_b[1bn._at]+_b[3._at])/2)) - (((_b[6._at]+_b[8._at])/2)- ((_b[2._at]+_b[4._at])/2)) //difference is significant
//Results are in line with H3

	*Inequality - figure
	local in_minus_sd=in_minus_sd
	local in_plus_sd=in_plus_sd
	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) inequality_aversion=(`in_minus_sd' `in_plus_sd')) post coefleg 

	local in_minus_sd=trust_minus_sd
	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) inequality_aversion=(`in_minus_sd')) post 
	eststo in_low

	local in_plus_sd=in_plus_sd
	estimates restore support_pro
	margins, at(Condition=(2 3 4 5) inequality_aversion=(`in_plus_sd')) post 
	eststo in_high

	coefplot   	(in_low,  msymbol(circle)       msize(medlarge) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02) label("Low inequality" "aversion")) ///
				(in_high, msymbol(hollowcircle) msize(medlarge) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02)  label("High inequality" "aversion")) ///
				, vert ytitle("Support for Proposal", size(medlarge)) title("Figure 3: Support for Proposal, Conditional on Treatment and Inequality Aversion", size(large) span) legend(cols(1)  subtitle("") position(4) size(medium) width(20))  ///
				ylabel(0(.1).8,labsize(medium) gmin gmax) level(95) xline(1.5 2.5 3.5, lcolor(gs10) lstyle(dot)) ///
				coeflabels 	(1._at= `" "Increase by" "Political Com." "'  ///
							 2._at=  `" "Increase by" "Independent Com." "' ///
							 3._at=  `" "Decrease by" "Political Com." "' ///
							 4._at=  `" "Decrease by" "Independent Com." "',  labsize(medium) ) ///
				caption("Note: Estimates with 95% confidence intervals (Based on model 1, appendix D)." ///
						"          Low/High inequality aversion defined as mean -/+ 1 standard deviation" , span size(medium)) ///
							xsize(6.5) ysize(3.5)
				graph export FIG3.emf, replace	
				
				
	*ALTERNATIVE - HORISONTAL 			
 /*	coefplot   	(in_low,  msymbol(circle)       msize(large) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02) label("Low level of inequality" "aversion (Mean - 1 SD)")) ///
				(in_high, msymbol(hollowcircle) msize(large) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02)  label("High level of inequality" "aversion (Mean + 1 SD)")) ///
				, xtitle("Support for Proposal", size(medlarge)) title("Figure 3: Support for Proposal, Conditional on Treatment and Inequality Aversion", size(vlarge)) legend(cols(1)  subtitle("") position(2) size(medlarge)) level(95) ///
				xlabel(0(.1).8,labsize(medium) gmin gmax) grid(none) ///
				coeflabels 	(1._at= `" "Increase suggested"  "by Political Com." "'  ///
							 2._at=  `" "Increase suggested"  "by Independent Com." "' ///
							 3._at=  `" "Decrease suggested"  "by Political Com." "' ///
							 4._at=  `" "Decrease suggested"  "by Independent Com." "', grid labsize(medlarge) ) ///
				caption(" " "Note: The figure illustrates mean support for proposed change in politicians pay, conditional on " ///
							"content of proposal, sponsor and inequality aversion (With 95% confidence intervals).", size(medium)) ///
							xsize(6.5) ysize(2.9)
				graph export FIG3a.emf, replace
 */
 
*INEQUALITY - additional exploratory analysis
	reg Support_proposal i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion i.Condition##i.Female i.Condition##c.Age i.Condition##i.edu3 i.Condition##i.partychoice //additional controls
	margins, dydx(inequality_aversion) at(Condition=(2 3 4 5)) post
	eststo support_pro_in_control	
		
		
		
**TRUST AND INEQUALITY - COMPARING EFFECT SIZES**
*************************************************
estimates restore support_pro
estat esize, omega //partial omega square is substantially larger for the interaction between treatment and trust than it is for interaction between treatment and inequality attitude




**********************************
***Warmth*************************
**********************************

reg Warmth i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
estimates store warmth_per
margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups) 
margins, at(Condition=(1 2 3 4 5)) post coeflegend
//Result are not in line with H6: No effects on perceptions of warmth
lincom  (_b[2._at]+_b[3._at]) - (_b[4._at]+_b[5._at])
//Result are not in line with H6 when we collapse groups with difference sponsors: No effects on perceptions of warmth
 

estimates restore warmth_per
margins, at(Condition=(1 2 3 4 5)) post
eststo warmth_plot

/*
coefplot   	(warmth_plot,  msymbol(circle) msize(medlarge) mcolor(gs12)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			, vert ytitle("Trust in Warmth", size(medlarge)) title("Figure 4: Trust in Politicians' Warmth, Conditional on Treatment", size(large)) legend(off order(0 " ") width(25)) ///
			ylabel(0.4(.05).6,labsize(medium) gmin gmax) xline(1.5 2.5 3.5 4.5, lcolor(gs10) lstyle(dot)) ///
			coeflabels 	(1._at= `" "Control"  "Condition" "'  ///
						 2._at=  `" "Increase by" "Political Com." "' ///
						 3._at=  `" "Increase by" "Independent Com." "' ///
						 4._at=  `" "Decrease by" "Political Com." "' ///
						 5._at=  `" "Decrease by" "Independent Com." "',  labsize(medium) ) ///
				caption("Note: Estimates with 95% confidence intervals (Based on model 2, appendix D)." , span size(medium)) ///
						xsize(6.5) ysize(3.5)
			graph export FIG4_old.emf, replace	
			
			
*ALTERNATIVE - HORISONTAL
coefplot   	(warmth_plot,  msymbol(circle) msize(large) mcolor(gs12)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			, xtitle("Trust in Warmth", size(medlarge)) title("Figure 4: Trust in Politicians' Warmth, Conditional on Treatment", size(large)) legend(off order(0 " ") width(25)) ///
			xlabel(0.3(.05).6,labsize(medium) gmin gmax) ///
			coeflabels 	(1._at= `" "Control"  "Condition" "'  ///
						 2._at=  `" "Increase suggested"  "by Political Com." "' ///
						 3._at=  `" "Increase suggested"  "by Independent Com." "' ///
						 4._at=  `" "Decrease suggested"  "by Political Com." "' ///
						 5._at=  `" "Decrease suggested"  "by Independent Com." "', labsize(medlarge) ) ///
				caption(" " "Note: The figure illustrates mean trust in politicians warmth, conditional on " ///
						"content and sponsor of proposal (With 95% confidence intervals).", size(medium)) ///
						xsize(5.5) ysize(3)
			graph export FIG4a_old.emf, replace	
*/

		
*Warmth - additional exploratory analysis
reg Warmth i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion i.Condition##i.Female i.Condition##c.Age i.Condition##i.edu3 i.Condition##i.partychoice  //additional controls					
estimates store warmth_per_control	

reg good_intentions i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups) 

reg personal_gain i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups)


				
					
**************************************
***Competence*************************
**************************************
reg Competence i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
estimates store competence_per
margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups)
//Result are not in line with H7: No effects on perceptions of competence
margins, at(Condition=(1 2 3 4 5)) post coeflegend
lincom  (_b[2._at]+_b[3._at]) - (_b[4._at]+_b[5._at])
//Result are not in line with H7 when we collapse groups with difference sponsors: No effects on perceptions of competence

estimates restore competence_per
margins, at(Condition=(1 2 3 4 5)) post
eststo comp_plot

/*
coefplot   	(comp_plot,  msymbol(circle) msize(medlarge) mcolor(gs12)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			, vert ytitle("Trust in Competence", size(medlarge)) title("Figure 5: Trust in Politicians' Competence, Conditional on Treatment", size(large)) legend(off order(0 " ") width(25))  ///
			ylabel(0.4(.05).6,labsize(medium) gmin gmax) xline(1.5 2.5 3.5 4.5, lcolor(gs10) lstyle(dot)) ///
			coeflabels 	(1._at= `" "Control"  "Condition." "'  ///
						 2._at=  `" "Increase by" "Political Com." "' ///
						 3._at=  `" "Increase by" "Independent Com." "' ///
						 4._at=  `" "Decrease by" "Political Com." "' ///
						 5._at=  `" "Decrease by" "Independent Com." "', labsize(medium) ) ///
				caption("Note: Estimates with 95% confidence intervals (Based on model 3, appendix D)." , span size(medium)) ///
						xsize(6.5) ysize(3.5)
			graph export FIG5_old.emf, replace	
			
			
	coefplot   	(comp_plot,  msymbol(circle) msize(large) mcolor(gs14)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			,  xtitle("Trust in Competence", size(medlarge)) title("Figure 5: Trust in Politicians' Competence, Conditional on Treatment", size(vlarge)) ///
			xlabel(0.3(.05).6,labsize(medium) gmin gmax) ///
			coeflabels 	(1._at= `" "Control"  "Condition." "'  ///
						 2._at=  `" "Increase suggested"  "by Polilitical Com." "' ///
						 3._at=  `" "Increase suggested"  "by Independent Com." "' ///
						 4._at=  `" "Decrease suggested"  "by Political Com." "' ///
						 5._at=  `" "Decrease suggested"  "by Independent Com." "', labsize(medlarge) ) ///
				caption(" " "Note: The figure illustrates mean trust in politicians competence, conditional on " ///
						"content and sponsor of proposal (With 95% confidence intervals).", size(medium)) ///
						xsize(5.5) ysize(3)
			graph export FIG5a_old.emf, replace	
*/			
 
*Competence - additional exploratory analysis
reg Competence i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion i.Female Age i.edu3 i.partychoice //additional controls					
estimates store competence_per_control	

reg mostly_competent i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups)				
	
reg right_decisions i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion c.inequality_aversion
margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups)				


***************************************************************
***Warmth and Competence in one figure*************************
***************************************************************
coefplot   	(warmth_plot,  msymbol(circle) msize(medlarge) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02) label("Trust in" "warmth")) ///
			(comp_plot,  msymbol(circle) msize(medlarge) mcolor(gs16)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02) label("Trust in" "competence")) ///
			, vert ytitle("Trust", size(medlarge)) title("Figure 4: Trust in Politicians' Warmth and Competence, Conditional on Treatment", size(large)) legend(cols(1)  subtitle("") position(4) size(medium) width(20)) ///
			ylabel(0.4(.02).54,labsize(medium) gmin gmax) xline(1.5 2.5 3.5 4.5, lcolor(gs10) lstyle(dot)) ///
			coeflabels 	(1._at= `" "Control"  "Condition." "'  ///
						 2._at=  `" "Increase by" "Political Com." "' ///
						 3._at=  `" "Increase by" "Independent Com." "' ///
						 4._at=  `" "Decrease by" "Political Com." "' ///
						 5._at=  `" "Decrease by" "Independent Com." "', labsize(medium) ) ///
				caption("Note: Estimates with 95% confidence intervals (Based on model 2 and 3, appendix D)." , span size(medium)) ///
						xsize(6.5) ysize(3.5)
			graph export FIG4_new.emf, replace	

	
*******************************************************************
***Effects on Warmth and Competence, conditional on sponsor (H8)***					
*******************************************************************

estimates restore warmth_per
margins, at(Condition=(1 2 3 4 5)) post coeflegend
lincom  (_b[2._at]+_b[4._at]) - (_b[3._at]+_b[5._at])
//Result are not in line with H8 on warmth

estimates restore competence_per
margins, at(Condition=(1 2 3 4 5)) post coeflegend
lincom  (_b[2._at]+_b[4._at]) - (_b[3._at]+_b[5._at])
//Result are not in line with H8 on competence



						
************************************
***Manipulation check***************
************************************

*Recall of proposal
tab correct_recall // 81.6% of respondents correctly remembered content of proposal 
tab correct_recall Condition, chi col //Curiously, respondents are better at remembering the content, when proposal is "increase"
tab correct_recall Increase_proposal, chi col //difference significant

*Perception of autonomy
tab Influence Pol_proposal, chi
reg Influence i.Pol_proposal
eststo influence_pol
margins, over(Pol_proposal) pwcompare(effects groups) //Commision described as autonomous is also rated more autonomous, although not large differences
reg Influence i.Condition
eststo influence_all
margins, over(Condition) pwcompare(effects groups) //content of proposal (decrease/increase) clearly also affects perception of autonomy
margins, at(Condition=(2 3 4 5)) post 
eststo plot_influence
coefplot   	(plot_influence,  msymbol(circle) msize(medlarge) mcolor(gs12)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			, vert ytitle("Perceived influence of politicians", size(medlarge)) title("Figure 5: Perceptions of Influence, Conditional on Treatment", size(large)) ///
			ylabel(0(.1).8,labsize(medium) gmin gmax) xline(1.5 2.5 3.5, lcolor(gs10) lstyle(dot)) ///
			coeflabels 	(1._at=  `" "Increase by" "Political Com." "'  ///
						 2._at=  `" "Increase by" "Independent Com." "' ///
						 3._at=  `" "Decrease by" "Political Com." "' ///
						 4._at=  `" "Decrease by" "Independent Com." "',  labsize(medlarge) ) ///
				caption("Note: Estimates with 95% confidence intervals.", size(medium)) ///
						xsize(6.5) ysize(3.5)
			graph export FIG5_new.emf, replace	

*ALTERNATIVE - HORISONTAL			
/* coefplot   	(plot_influence,  msymbol(circle) msize(large) mcolor(gs14)  mlcolor(black) ciopts(recast(rspike) color(black))) ///
			,  xtitle("Perceived influence of politicians", size(medlarge)) title("Figure 6: Perceptions of Influence, Conditional on Treatment", size(vlarge)) ///
			xlabel(0.2(.1).8,labsize(medium) gmin gmax) ///
			coeflabels 	(1._at=  `" "Increase suggested"  "by Political Com." "'  ///
						 2._at=  `" "Increase suggested"  "by Independent Com." "' ///
						 3._at=  `" "Decrease suggested"  "by Political Com." "' ///
						 4._at=  `" "Decrease suggested"  "by Independent Com." "', grid labsize(medlarge) ) ///
				caption(" " "Note: The figure illustrates mean assessment of politicians' influence on proposal, conditional on" ///
						"content and sponsor of proposal (With 95% confidence intervals).", size(medium)) ///
						xsize(5.5) ysize(3)
			graph export FIG6a.emf, replace				
*/
			
*Perception of autonomy, conditional on trust and inequality attitude*				

reg Influence i.Condition##c.trust i.Condition##c.inequality_aversion
eststo influence_cov
margins, dydx(trust) at(Condition=(2 3 4 5))
margins, dydx(inequality_aversion) at(Condition=(2 3 4 5))
					
	*trust					
	local trust_minus_sd=trust_minus_sd
	estimates restore influence_cov
	margins, at(Condition=(2 3 4 5) trust=(`trust_minus_sd')) post 
	eststo mani_trust_low

	local trust_plus_sd=trust_plus_sd
	estimates restore influence_cov
	margins, at(Condition=(2 3 4 5) trust=(`trust_plus_sd')) post 
	eststo mani_trust_high


	coefplot   	(mani_trust_low,  msymbol(circle)       msize(medlarge) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02) label("Low level" "of trust")) ///
				(mani_trust_high, msymbol(hollowcircle) msize(medlarge) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02)  label("High level" "of trust")) ///
				, vert ytitle("Perceived influence of politicians", size(medlarge)) title("Figure E1: Perceptions of Influence, Conditional on Treatment and Trust", size(medlarge)) legend(cols(1)  subtitle("") position(4) size(large)) ///
				ylabel(0(.1).8,labsize(medium) gmin gmax) level(95) xline(1.5 2.5 3.5, lcolor(gs10) lstyle(dot)) ///
				coeflabels 	(1._at= `" "Increase by" "Political Com." "'  ///
							 2._at=  `" "Increase by" "Independent Com." "' ///
							 3._at=  `" "Decrease by" "Political Com." "' ///
							 4._at=  `" "Decrease by" "Independen Com." "', labsize(medium) ) ///
				caption("Note: Estimates with 95% confidence intervals." ///
						"          Low/High level of trust defined as mean -/+ 1 standard deviation" , span size(medium)) ///
							xsize(6.5) ysize(3.5)
				graph export FIG_E1.emf, replace	
			
	*ALTERNATIVE		
	coefplot   	(mani_trust_low,  msymbol(circle)       msize(large) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02) label("Low level of trust" "(Mean - 1 SD)")) ///
				(mani_trust_high, msymbol(hollowcircle) msize(large) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02)  label("High level of trust" "(Mean + 1 SD)")) ///
				, xtitle("Perceived influence of politicians", size(medlarge)) title("Figure E1: Perceptions of Influence, Conditional on Treatment and Trust", size(vlarge)) legend(cols(1)  subtitle("") position(2) size(large)) level(95) ///
				xlabel(0.2(.1).8,labsize(medium) gmin gmax) grid(none) ///
				coeflabels 	(1._at= `" "Increase suggested"  "by Political Com." "'  ///
							 2._at=  `" "Increase suggested"  "by Independent Com." "' ///
							 3._at=  `" "Decrease suggested"  "by Political Com." "' ///
							 4._at=  `" "Decrease suggested"  "by Independen Com." "', grid labsize(medlarge) ) ///
				caption(" " "Note: The figure illustrates mean assessment of politicians' influence on proposal, conditional on" ///
						"content content, sponsor of proposal and trust(With 95% confidence intervals).", size(medium)) ///
							xsize(6.5) ysize(3)
				graph export FIG_E1a.emf, replace	
			
	*inequality
	local in_minus_sd=in_minus_sd
	estimates restore influence_cov
	margins, at(Condition=(2 3 4 5) inequality_aversion=(`in_minus_sd')) post 
	eststo mani_in_low

	local in_plus_sd=in_plus_sd
	estimates restore influence_cov
	margins, at(Condition=(2 3 4 5) inequality_aversion=(`in_plus_sd')) post 
	eststo mani_in_high


	coefplot   	(mani_in_low,  msymbol(circle)       msize(medlarge) mcolor(gs8)  mlcolor(black) ciopts(recast(rspike) color(black)) offset(.02) label("Low Inequality" "aversion")) ///
				(mani_in_high, msymbol(hollowcircle) msize(medlarge) mcolor(gs16) mlcolor(black) ciopts(recast(rspike) color(black)) offset(-.02)  label("High Inequality" "aversion")) ///
				, vert ytitle("Perceived influence of politicians", size(medlarge)) title("Figure E2: Perceptions of Influence, Conditional on Treatment and Inequality Aversion", size(medlarge)) legend(cols(1)  subtitle("") position(4) size(large)) level(95) ///
				ylabel(0(.1).8,labsize(medium) gmin gmax) grid(none) xline(1.5 2.5 3.5, lcolor(gs10) lstyle(dot)) ///
				coeflabels 	(1._at= `" "Increase by" "Political Com." "'  ///
							 2._at=  `" "Increase by" "Independent Com." "' ///
							 3._at=  `" "Decrease by" "Political Com." "' ///
							 4._at=  `" "Decrease by" "Independen Com." "', labsize(medlarge) ) ///
				caption("Note: Estimates with 95% confidence intervals." ///
						"          Low/High inequality aversion defined as mean -/+ 1 standard deviation" , span size(medium)) ///
							xsize(6.5) ysize(3.5)
				graph export FIG_E2.emf, replace

								
			
										
************************************************
***TABLES***************************************
************************************************

esttab 	 support_pro warmth_per competence_per  using regression_table.rtf, r2 b(2) se(2) compress wide label replace interaction(" x ") ///
		mtitles("Support for proposal" "Trust in Warmth" "Trust in Competence" ) ///
		order(1.Condition 2.Condition 3.Condition 4.Condition 5.Condition ///
		trust 1.Condition#c.trust 2.Condition#c.trust 3.Condition#c.trust 4.Condition#c.trust 5.Condition#c.trust ///
		inequality_aversion 1.Condition#c.inequality_aversion 2.Condition#c.inequality_aversion ///
		3.Condition#c.inequality_aversion 4.Condition#c.inequality_aversion 5.Condition#c.inequality_aversion ///
		_cons) ///
		note("Notes: OLS regression coefficients (and standard errors).")
		
		
esttab 	support_pro_trust support_pro_trust_control support_pro_in  support_pro_in_control using marginals.rtf, b(2) se(2) compress wide  replace ///
		coeflabels	(1._at "Increase suggested by Pol. Comm." ///
					 2._at "Increase suggested by Ind. Comm." ///
					 3._at "Decrease suggested by Pol. Comm" ///
					 4._at "Decrease suggested by Ind. Comm.") ///
		mtitles("Results from Model 1" "Results with additional controls" "Results from Model 1" "Results with additional controls" )
		
		
estimates store clear

****************
***Robustness***
****************

*What happens if we exclude the LR-item from our inequality measure?
	alpha smalldif largedif, item std gen(uns_inequality_attitude_noLR) //Internal reliability is acceptable
	egen uns_inequality_attitude_min_noLR=min(uns_inequality_attitude_noLR) //these lines standardize the measure to 0-1
	egen uns_inequality_attitude_max_noLR=max(uns_inequality_attitude_noLR) //these lines standardize the measure to 0-1
	gen inequality_aversion_noLR=1-(uns_inequality_attitude_noLR-uns_inequality_attitude_min_noLR)/(uns_inequality_attitude_max_noLR-uns_inequality_attitude_min_noLR) //these lines standardize the measure to 0-1, AND CHANGE THE DIRECTION!
	label variable inequality_aversion "Aversion to Economic Inequality"
	egen float inequality_aversion_high_noLR = cut(inequality_aversion_noLR), group(2) icodes
	sum inequality_aversion_noLR
	gen in_minus_sd_noLR=(r(mean)-r(sd))
	gen in_plus_sd_noLR=(r(mean)+r(sd))
	
	reg Support_proposal i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion_noLR c.inequality_aversion_noLR
	estimates store support_pro_noLR 
	margins, at(Condition=(2 3 4 5)) pwcompare(effects groups) //main effects are substantially identical (hypotheses 1, 2 and 3)
	margins, dydx(trust) at(Condition=(2 3 4 5)) pwcompare(effects groups) //moderating effect of trust substantially identical (hypothesis 4)
	margins, dydx(inequality_aversion) at(Condition=(2 3 4 5)) pwcompare(effects groups) //moderating effect of inequality aversion substantially identical (hypothesis 5)
	
	reg Warmth i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion_noLR c.inequality_aversion_noLR
	estimates store warmth_per_noLR	
	margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups) //Same conclusion on Hypothesis 6

	reg Competence i.Condition i.Condition#c.trust c.trust i.Condition#c.inequality_aversion_noLR c.inequality_aversion_noLR
	estimates store competence_per_noLR	
	margins, at(Condition=(1 2 3 4 5)) pwcompare(effects groups) //Same conclusion on Hypothesis 7

	estimates restore warmth_per_noLR	
	margins, at(Condition=(1 2 3 4 5)) post coeflegend
	lincom  (_b[2._at]+_b[4._at]) - (_b[3._at]+_b[5._at]) //Same conclusion on Hypothesis 8, warmth

	estimates restore competence_per_noLR	
	margins, at(Condition=(1 2 3 4 5)) post coeflegend
	lincom  (_b[2._at]+_b[4._at]) - (_b[3._at]+_b[5._at]) //Same conclusion on Hypothesis 8, competence



***********************************
***THE END*************************
***********************************
